interface columnData {
  title: string
  dataIndex: string
  className?: string
  customRender?: (text: any, record: any, index: number) => any
}

export const columns: Array<columnData> = [
  {
    title: '菜单名称',
    dataIndex: 'name'
  },
  {
    title: '显示顺序',
    dataIndex: 'orderNum'
  },
  {
    title: '菜单类型',
    dataIndex: 'menuType',
    customRender: ({ text }) => {
      return menuTypeEnum[text]
    }
  },
  {
    title: '菜单状态',
    dataIndex: 'status',
    customRender: ({ text }) => {
      return statusEnum[text]
    }
  },
  {
    title: '权限标识',
    dataIndex: 'perms'
  },
  {
    title: '操作',
    dataIndex: 'operate'
  }
]

//M目录 C菜单 F按钮
const menuTypeEnum: Record<string, string> = {
  M: '目录',
  C: '菜单',
  F: '按钮'
}

//显示状态（0显示 1隐藏）
const visibleEnum: Record<number, string> = {
  0: '显示',
  1: '隐藏'
}

//菜单状态（0正常 1停用）
const statusEnum: Record<number, string> = {
  0: '正常',
  1: '停用'
}
